package com.quantdo.client;

import org.eclipse.swt.graphics.Point;
import org.eclipse.ui.application.ActionBarAdvisor;
import org.eclipse.ui.application.IActionBarConfigurer;
import org.eclipse.ui.application.IWorkbenchWindowConfigurer;
import org.eclipse.ui.application.WorkbenchWindowAdvisor;

import com.quantdo.demo.IndexApplicationWorkbenchWindowAdvisor;

public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

    public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
        super(configurer);
        System.out.printf("class:%s, function:%s() enter \n", ApplicationWorkbenchWindowAdvisor.class, "ApplicationWorkbenchWindowAdvisor");
    }

    public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
    	System.out.printf("class:%s, function:%s() enter \n", ApplicationWorkbenchWindowAdvisor.class, "createActionBarAdvisor");
        return new ApplicationActionBarAdvisor(configurer);
    }
    
    public void preWindowOpen() {
    	System.out.printf("class:%s, function:%s() enter \n", ApplicationWorkbenchWindowAdvisor.class, "preWindowOpen");
        IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
        configurer.setInitialSize(new Point(400, 300));
        configurer.setShowCoolBar(false);
        configurer.setShowStatusLine(false);
        configurer.setTitle("Hello RCP"); //$NON-NLS-1$

        IndexApplicationWorkbenchWindowAdvisor advisor = new IndexApplicationWorkbenchWindowAdvisor();
        advisor.preWindowOpen(configurer);
    }
}
